<?php

# PMB Online
# Aplikasi PMB Online untuk Pendaftaran Calon Mahasiswa di PT/PTS Indonesia
# 
# version 1.0
# class home
# file
# created Jan 23, 2013 7:21:29 AM
# 
# (c)2012, arif.laksito@gmail.com

if (!defined('BASEPATH'))
    exit('No direct script access allowed');
?>
<h3>Home</h3>
<ul class="breadcrumb">
  <li>PMB Online <span class="divider">/</span></li>  
  <li>Home</li>
</ul>

<p>
    Selamat Datang <?php echo $sess['name']?> di Aplikasi PMB Online,<br />
    Terakhir kali anda login menggunakan aplikasi ini <?php echo timeago($sess['log'])?> tangggal 
    <?php echo mdate('%d %M %Y jam %H:%i',mysql_to_unix($sess['log']))?> 
</p>
<br />

<h4>Grafik Kelulusan PMB</h4>
<div class="row">
    <div class="span6">
        <img src="<?php echo base_url()?>cgraph/bar_mhs"/>
    </div>
    <div class="span5">
        <br />
        <table class="table table-striped table-bordered">
            <tr>
                <th>Nama Gelombang</th>
                <th>Jml Lulus</th>
                <th>Jml Tdk Lulus</th>
                <th>Jml Blm Lulus</th>
                <th>Jml Total</th>
            </tr>
            <?php $n=0; $l=0; $t=0?>
            <?php foreach($stats as $s):?>
            <?php $n += $s['nlulus']?>
            <?php $l += $s['lulus']?>
            <?php $t += $s['tlulus']?>
            <tr>
                <td><?php echo $s['gel']?></td>
                <td style="text-align:right"><?php echo $s['lulus']?></td>
                <td style="text-align:right"><?php echo $s['tlulus']?></td>
                <td style="text-align:right"><?php echo $s['nlulus']?></td>
                <td style="text-align:right"><?php echo $s['nlulus']+$s['lulus']+$s['tlulus']?></td>
            </tr>
            <?php endforeach?>
            <tr>
                <th>Total Data</th>
                <th style="text-align:right"><?php echo $l?></th>
                <th style="text-align:right"><?php echo $t?></th>
                <th style="text-align:right"><?php echo $n?></th>
                <th style="text-align:right"><?php echo $n+$l+$t?></th>
            </tr>
        </table>
    </div>
</div>
<h4>Grafik Pendaftaran Online/Offline PMB</h4>
<div class="row">
    <div class="span6"><img src="<?php echo base_url()?>cgraph/bar_ol"/></div>
    <div class="span5">
        <br />
        <table class="table table-striped table-bordered">
            <tr>
                <th>Nama Gelombang</th>
                <th>Jml Online</th>
                <th>Jml Offline</th>
                <th>Jml Total</th>
            </tr>
            <?php $n=0; $l=0;?>
            <?php foreach($ol as $s):?>
            <?php $n += $s['ol']?>
            <?php $l += $s['off']?>
            <tr>
                <td><?php echo $s['gel']?></td>
                <td style="text-align:right"><?php echo $s['ol']?></td>
                <td style="text-align:right"><?php echo $s['off']?></td>
                <td style="text-align:right"><?php echo $s['ol']+$s['off']?></td>
            </tr>
            <?php endforeach?>
            <tr>
                <th>Total Data</th>
                <th style="text-align:right"><?php echo $n?></th>
                <th style="text-align:right"><?php echo $l?></th>
                <th style="text-align:right"><?php echo $n+$l?></th>
            </tr>
        </table>
    </div>
</div>
<h4>Grafik Sekolah Asal</h4>
<div class="row">
    <div class="span6"><img src="<?php echo base_url()?>cgraph/bar_asal"/></div>
    <div class="span5">
        <br />
        <table class="table table-striped table-bordered">
            <tr>
                <th>Nama Sekolah</th>
                <th>Jml Pendaftar</th>
            </tr>            
            <?php $t = 0?>
            <?php foreach($as as $s):?>            
            <tr>
                <td><?php echo $s['sekolah_asal']?></td>
                <td style="text-align:right"><?php echo $s['jml']?></td>                
            </tr>
            <?php $t = $t+$s['jml']?>
            <?php endforeach?>
            <tr>
                <td>(Data Kosong)</td>
                <td style="text-align:right"><?php echo ($n+$l)-$t?></td>                
            </tr>
            <tr>
                <th>Total Data</th>
                <th style="text-align:right"><?php echo $n+$l?></th>                
            </tr>
        </table>
    </div>
</div>    
<h4>Grafik Informasi Pendaftaran</h4>
<div class="row">
    <div class="span6"><img src="<?php echo base_url()?>cgraph/bar_info"/></div>
    <div class="span5">
        <table class="table table-striped table-bordered">
            <tr>
                <th>Informasi Pendaftaran</th>
                <th>Jumlah Data</th>
            </tr>                        
            <?php foreach($if as $k=>$s):?>            
            <tr>
                <td><?php echo $k?></td>
                <td style="text-align:right"><?php echo $s['jml']?></td>                
            </tr>            
            <?php endforeach?>                        
        </table>
    </div>
</div>    
<br />

